Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance: broadcast with event-based notification #39522

Merged

Conversation

chyezh
Copy link
Contributor

@chyezh chyezh commented Jan 22, 2025

issue: #38399

  • broadcast message can carry multi resource key now.
  • implement event-based notification for broadcast messages
  • broadcast message use broadcast id as a unique identifier in message
  • broadcasted message on vchannels keep the broadcasted vchannel now.
  • broadcasted message and broadcast message have a common broadcast header now.

@sre-ci-robot sre-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines. label Jan 22, 2025
@mergify mergify bot added dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement labels Jan 22, 2025
Copy link
Contributor

mergify bot commented Jan 22, 2025

@chyezh E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Copy link
Contributor

mergify bot commented Jan 22, 2025

@chyezh go-sdk check failed, comment rerun go-sdk can trigger the job again.

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 86.64495% with 123 lines in your changes missing coverage. Please review.

Project coverage is 81.05%. Comparing base (7476eb3) to head (d75e801).
Report is 40 commits behind head on master.

Files with missing lines Patch % Lines
...nternal/streamingcoord/server/service/broadcast.go 23.33% 21 Missing and 2 partials ⚠️
pkg/streaming/util/message/message_impl.go 44.44% 11 Missing and 9 partials ⚠️
...al/streamingcoord/client/broadcast/grpc_watcher.go 85.03% 16 Missing and 3 partials ⚠️
...treamingcoord/client/broadcast/watcher_resuming.go 87.25% 11 Missing and 2 partials ⚠️
...amingcoord/server/broadcaster/broadcast_manager.go 92.50% 6 Missing and 3 partials ⚠️
...server/service/broadcast/broadcast_watch_server.go 88.05% 6 Missing and 2 partials ⚠️
pkg/streaming/util/message/broadcast.go 88.52% 6 Missing and 1 partial ⚠️
...ernal/streamingcoord/server/broadcaster/watcher.go 90.32% 6 Missing ⚠️
pkg/log/with_logger.go 44.44% 3 Missing and 2 partials ⚠️
pkg/streaming/util/message/builder.go 66.66% 1 Missing and 3 partials ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #39522       +/-   ##
===========================================
+ Coverage   69.56%   81.05%   +11.49%     
===========================================
  Files         300     1418     +1118     
  Lines       26986   199595   +172609     
===========================================
+ Hits        18773   161788   +143015     
- Misses       8213    32096    +23883     
- Partials        0     5711     +5711     
Components Coverage Δ
Client 79.50% <ø> (∅)
Core 69.58% <ø> (+0.01%) ⬆️
Go 82.98% <86.49%> (∅)
Files with missing lines Coverage Δ
internal/coordinator/coordclient/registry.go 91.17% <ø> (ø)
internal/distributed/streaming/append.go 74.19% <ø> (ø)
internal/distributed/streaming/broadcast.go 100.00% <100.00%> (ø)
internal/distributed/streaming/streaming.go 100.00% <ø> (ø)
internal/distributed/streaming/wal.go 64.86% <100.00%> (ø)
internal/metastore/catalog.go 100.00% <ø> (ø)
internal/metastore/kv/streamingcoord/kv_catalog.go 79.31% <100.00%> (ø)
internal/rootcoord/broadcast_task.go 9.61% <ø> (ø)
internal/streamingcoord/client/client.go 97.01% <100.00%> (ø)
internal/streamingcoord/client/client_impl.go 81.81% <100.00%> (ø)
... and 24 more

... and 1085 files with indirect coverage changes

@chyezh chyezh force-pushed the enhance_broadcast_with_resource_lock branch from cd1b827 to 4877b2d Compare January 22, 2025 15:15
Copy link
Contributor

mergify bot commented Jan 22, 2025

@chyezh E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

@chyezh chyezh force-pushed the enhance_broadcast_with_resource_lock branch from 4877b2d to 752ff02 Compare January 23, 2025 01:43
Copy link
Contributor

mergify bot commented Jan 23, 2025

@chyezh E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

- broadcast message can carry multi resource key now.
- implement event-based notification for broadcast messages
- broadcast message use broadcast id as a unique identifier in message
- broadcasted message on vchannels keep the broadcasted vchannel now.
- broadcasted message and broadcast message have a common broadcast
  header now.

Signed-off-by: chyezh <[email protected]>
Signed-off-by: chyezh <[email protected]>
@chyezh chyezh force-pushed the enhance_broadcast_with_resource_lock branch from 752ff02 to d75e801 Compare January 23, 2025 02:41
Copy link
Contributor

mergify bot commented Jan 23, 2025

@chyezh E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

@chyezh
Copy link
Contributor Author

chyezh commented Jan 23, 2025

/run-cpu-e2e

@mergify mergify bot added the ci-passed label Jan 23, 2025
@chyezh chyezh added this to the 2.6.0 milestone Jan 23, 2025
// We should always save the task after acked.
// Even if the task mark as done in memory.
// Because the task is set as done in memory before save the recovery info.
return b.saveTask(ctx, b.Logger().With(zap.String("ackVChannel", vchannel)))
Copy link
Contributor

@jaime0815 jaime0815 Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should save the task state before updating its value in memory to avoid receiving a completed task state on the watch side if the persistence fails

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.
Current behaviour make the watcher see the event done than event undone after the coord recovery.
It's ok because the consumer of broadcast message will acknowledge until success.
I will add a rollback logic if the save operation is failure in next PR to avoid it.

@jaime0815
Copy link
Contributor

fix the unresolved issue in the next PR.

@jaime0815
Copy link
Contributor

/lgtm

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: chyezh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot merged commit a9e0e0a into milvus-io:master Feb 7, 2025
20 checks passed
@chyezh chyezh deleted the enhance_broadcast_with_resource_lock branch February 7, 2025 03:26
@jaime0815
Copy link
Contributor

The implementation of this gRPC streaming watch mechanism is somewhat repetitive, suggesting to create a common watch function module in the future.

@chyezh chyezh restored the enhance_broadcast_with_resource_lock branch February 7, 2025 03:36
@chyezh chyezh deleted the enhance_broadcast_with_resource_lock branch February 7, 2025 03:36
sre-ci-robot pushed a commit that referenced this pull request Feb 7, 2025
issue: #38399
pr: #39522

- broadcast message can carry multi resource key now.
- implement event-based notification for broadcast messages
- broadcast message use broadcast id as a unique identifier in message
- broadcasted message on vchannels keep the broadcasted vchannel now.
- broadcasted message and broadcast message have a common broadcast
header now.

---------

Signed-off-by: chyezh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/internal-api area/test ci-passed dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement lgtm sig/testing size/XXL Denotes a PR that changes 1000+ lines. test/integration integration test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants